<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
  <title>求两个数的和</title>
  <script>
    function addNumbers(a, b) {
      return a + b;
    }

    function calculateSum() {
      var num1 = parseFloat(document.getElementById("num1").value);
      var num2 = parseFloat(document.getElementById("num2").value);
      var result = addNumbers(num1, num2);
      document.getElementById("result").textContent = "两个数的和为: " + result;
    }
  </script>
</head>
<body>
  <h1>求两个数的和</h1>
  <input type="number" id="num1" placeholder="请输入第一个数">
  <input type="number" id="num2" placeholder="请输入第二个数">
  <button onclick="calculateSum()">计算和</button>
  <p id="result"></p>
</body>
</html>
